module.exports = function ($scope, $resource, $modal, toaster) {

	
    init();
    function init(){
        $resource('/api/ac/pc/packageService/getPackageBuyList', {}, {}).save({}, function(res){
            if (res.errcode === 0){
				$scope.package_list = res.data;
            } else {
                toaster.error({title: '', body: '加载事件列表失败, 请刷新页面'});
            }
        });
    };

    $scope.getInfo = function(obj,flag){
        var modalInstance = $modal.open({
			template: require('../views/packageInfo.html'),
			controller: 'packageInfo',
			size: 'lg',
			resolve: {
				obj: function () {
					return obj;
				},
				flag: function () {
					return flag;
				},
			}
		});
		//关闭模态框刷新页面
		modalInstance.result.then(function(result){
            init();
		});
    }




};